package web

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"testPaper/common"
	"testPaper/model"
	"testPaper/response"
)

// DeleteCaseTopic 删除案例小题
func DeleteCaseTopic(c *gin.Context) {
	DB := common.GetDB()
	id := c.PostForm("id")

	if id == "" {
		response.Reponse(c, http.StatusOK, 422, nil, "试卷ID不能为空")
		return
	}
	var newTopic model.NewTopic
	DB.Debug().Unscoped().Where("id = ?", id).Delete(&newTopic)

	response.Reponse(c, http.StatusOK, 200, nil, "删除成功")
	return
}
